package com.zzit.vjv.entity;

import com.sun.net.httpserver.HttpServer;

import java.io.Serializable;
import java.util.List;

/**
 * 用户表实体类
 */
public class User  implements Serializable {


    private Integer id;//id主键
    private String userCode;//用户编码
    private String userName;//用户
    private String userPassword;//用户密码
    private Integer gender;//性别
    private String birthday;//出生日期
    private String phone;//电话
    private String address;  //地址
    private Integer userRole;//用户角色（取自角色表-角色id）
    private Integer createdBy;//创建用户角色者
    private String creationDate;//创建时间
    private Integer modifyBy;//更新者
    private String modifyDate;//更新时间


    //收货地址依赖关系对象 用于多对多查询
    private List<Address> addressAndUser;


    //用于表达传值集合
    private List<User> addUsersList;

    public List<User> getAddUsersList() {
        return addUsersList;
    }

    public void setAddUsersList(List<User> addUsersList) {
        this.addUsersList = addUsersList;
    }

    /**
     * 无参构造
     */
    public User() {

    }

    /**
     * 有参构造
     *
     * @param id           id
     * @param userCode     用户编码
     * @param userName     用户名称
     * @param userPassword 用户密码
     * @param gender       性别
     * @param birthday     出生日期
     * @param phone        电话
     * @param address      地址
     * @param userRole     用户角色
     * @param createdBy    创建者
     * @param creationDate 创建时间
     * @param modifyBy     更新者
     * @param modifyDate   更新时间
     */
    public User(Integer id, String userCode, String userName, String userPassword, Integer gender, String birthday, String phone, String address, Integer userRole, Integer createdBy, String creationDate, Integer modifyBy, String modifyDate) {
        this.id = id;
        this.userCode = userCode;
        this.userName = userName;
        this.userPassword = userPassword;
        this.gender = gender;
        this.birthday = birthday;
        this.phone = phone;
        this.address = address;
        this.userRole = userRole;
        this.createdBy = createdBy;
        this.creationDate = creationDate;
        this.modifyBy = modifyBy;
        this.modifyDate = modifyDate;

    }

    public List<Address> getAddressAndUser() {
        return addressAndUser;
    }

    public void setAddressAndUser(List<Address> addressAndUser) {
        this.addressAndUser = addressAndUser;
    }

    public String getAddress() {
        return address;
    }



    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getUserRole() {
        return userRole;
    }

    public void setUserRole(Integer userRole) {
        this.userRole = userRole;
    }

    public Integer getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Integer createdBy) {
        this.createdBy = createdBy;
    }

    public String getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(String creationDate) {
        this.creationDate = creationDate;
    }

    public Integer getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(Integer modifyBy) {
        this.modifyBy = modifyBy;
    }

    public String getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(String modifyDate) {
        this.modifyDate = modifyDate;
    }


    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", userCode='" + userCode + '\'' +
                ", userName='" + userName + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", gender=" + gender +
                ", birthday='" + birthday + '\'' +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", userRole=" + userRole +
                ", createdBy=" + createdBy +
                ", creationDate='" + creationDate + '\'' +
                ", modifyBy=" + modifyBy +
                ", modifyDate='" + modifyDate + '\'' +
                '}';
    }
}
